package com.yun.zf.admin.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yun.zf.common.admin.dto.HousePactMo;
import com.yun.zf.common.admin.dto.house.House;
import com.yun.zf.common.admin.dto.house.PactHouseDto;
import com.yun.zf.common.admin.model.house.HouseListMo;
import com.yun.zf.common.admin.model.search.HouseSearchMo;
import com.yun.zf.common.app.domain.ZfHouseBasic;
import com.yun.zf.common.app.dto.community.CommunityTotal;
import com.yun.zf.common.vo.Response;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 房源表 服务类
 * </p>
 *
 * @author cj
 * @since 2021-01-29
 */
public interface ZfHouseBasicService extends IService<ZfHouseBasic> {

    public Long addHouseBasic(ZfHouseBasic houseBasic);

    public int selectHouseBasic(Long id,Long provinceCode,Long cityCode );

    public ZfHouseBasic getHouseBasic(Long id,Long provinceCode,Long cityCode);

    public Map<String, Object> searchHouseBasic(HouseSearchMo searchMo);

    public House getHouseAllInfo (Long houseId, Long provCode, Long cityCode);

    public int selectCountByBasicId(Long houseId, Long provCode, Long cityCode,int agentNo);

    public Page<HouseListMo> houseBasic(Long provCode, Long cityCode, int agentNo, int current, int pageSize,int type);

    /**
     * 同小区房源在租或者在售房源
     * @param provCode
     * @param cityCode
     * @param current
     * @param pageSize
     * @return
     */
    public Page<HouseListMo> houseBasic(Long provCode, Long cityCode, Long communityId,int type,Long houseId , int current, int pageSize);

    public List<HouseListMo> houseBasic(Long provCode, Long cityCode, List<Long> ids);

    public HousePactMo searchHouseInfoToPact(String houseId, Long cityCode, Long provCode);

    public  int updateStatusAfterPact(Long basicId, Long cityCode, Long provCode,String status);

    /**
     * 统计小区在租和在售房源总数
     * @param provCode
     * @param cityCode
     * @return
     */
    public List<CommunityTotal> brandHouseTotal(Long provCode, Long cityCode);

    public List<ZfHouseBasic> getUnmaintainhouseBasic( List<Long> ids,Long provCode, Long cityCode);

    public  int updateStatusForMaintain(Long basicId, Long cityCode, Long provCode);

    /**
     * 房源推送发布
     */
    public Response houseToEs(Long houseId, Long provCode, Long cityCode);

    public CommunityTotal getDetailMaxAndMin(Long provCode, Long cityCode,Long communityId,int type);

    /**
     * 合同获取房源信息
     * @param houseId
     * @param provCode
     * @param cityCode
     */
    public PactHouseDto getPactHouseInfo(Long houseId, Long provCode, Long cityCode);

    public List<Map<String, Object>> getAgent(Long houseId, Long provCode, Long cityCode);
}
